-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test for reloading lookahead optimizer #2102
base: master
Are you sure you want to change the base?
Conversation
You are owner of some files modified in this pull request. |
The original tests mentioned in the ticket was testing model serializzation? |
The description from the ticket was inaccurate. I raised that issue and the problem is on save and reloading. Please check the the discussions in the issue(#2094) for more details. |
I was talking about save and reloading original contributor test in https://github.com/CyberZHG/keras-lookahead/blob/master/tests/test_optimizers.py |
That is a different way to save a model. The contributor test uses |
Just updated the test file referring to the original contributor test. I added cases of whether the inner optimizer contains slots (adam) or not (sgd) and different saving and reloading methods (weights only and whole graph). All tests of "sgd" pass and those of "adam" fail, which I believe should be enough to demonstrate the problem. |
Ok, have you double checked https://stackoverflow.com/questions/56805588/does-load-model-load-optimizer-state? |
@WindQAQ Let me know if you still find useful to have a save_weight/load_weight test. In that case give a pass over the test. |
* Update lookahead.py Inital fix of tensorflow#2094 tensorflow#2102 * Fix linting * Resolve name conflict with mixed prexision * Track baseline optimizer in avg
Description
Brief Description of the PR: add the test for saving and reloading a Lookahead optimizer. The added test function reveals the bug that the states of a lookahead's inner optimizer are not properly saved and reloaded (#2094). So the test can not pass currently.
Type of change
Checklist:
How Has This Been Tested?
If you're adding a bugfix or new feature please describe the tests that you ran to verify your changes: